#ifndef MAP_PATH_CREATOR_H
#define MAP_PATH_CREATOR_H

#include "GraphTypes.h"
#include "Vector2D.h"
#include "Path.h"
#include "Defines.hpp"

class MapPathCreator
{
private:
	int m_Width; 
	int m_Height;
	bool m_Created;

	// An arbitrary fully-edged NavGraph with proper dimensions.
	typedef SparseGraph<NavGraphNode<void*>, GraphEdge> MapGraph;
	MapGraph* m_pMapGraph;

	int GetClosestNodeToPosition(Vector2D pos);

public:
	MapPathCreator() {m_Created = false;}
	MapPathCreator(MapGraph Graph, int width, int height);
	~MapPathCreator() {if(m_pMapGraph != NULL) {NullDelete(m_pMapGraph); m_Created = false;}}
	
	void Init(const MapGraph& graph, const int& width, const int& height);

	Path* GeneratePath(Vector2D start, Vector2D end, bool noisy = false);
};

#endif